package com.zgm.ch06.aop.aspectJ.advice.argumentBind._2_6;

import java.math.BigDecimal;
import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zgm.ch06.aop.services.StockService;
import com.zgm.ch06.aop.services.UserService;

public class ArgumentBindDemo {

	public static void main(String[] args) {
		ApplicationContext ac = new ClassPathXmlApplicationContext("com/zgm/ch06/aop/aspectJ/advice/argumentBind/_2_6/_2_6-context.xml");
		
		StockService stockService = (StockService) ac.getBean("stockService"); 
//		
//		System.out.println(stockService.getStockLevel("ABC"));
		
		/*UserService userService = (UserService) ac.getBean("userService");
		userService.login("zgm");
		System.out.println(stockService.getStockLevel("EFG"));*/
		
		stockService.applyDiscounts(new Date(), new BigDecimal(1));
	}
}
